nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

HTML/Attributes and Elements

How elements are built from tags, content and attributes, and which attributes apply everywhere.

10 QuestionsBeginnerHigh Priority ~9 min read

An HTML element is more than a tag: it's the opening tag, its content, and the closing tag together, while attributes are name-value pairs inside the opening tag that configure behavior or provide extra information. Some elements are void (img, input, br, meta) and have no content or closing tag at all. Global attributes like id, class, style, title, lang, hidden, tabindex and data-* can be placed on any element, whereas others such as href, src or type only make sense on specific ones.

A subtle area interviewers probe is boolean attributes and the id versus class distinction. A boolean attribute like disabled or checked is true simply by being present — disabled="false" still disables the element. Likewise, an id must be unique per document and is used for anchors, labels and scripting hooks, while class is reusable. Custom data-* attributes give you a standards-friendly way to attach data to elements without inventing invalid attributes.

What you'll walk away knowing

The difference between a tag, an element and an attribute
What void elements are and why they have no closing tag
Why boolean attributes are true by presence and disabled="false" still disables
The roles of id, class and data-* attributes, and the rule that ids must be unique
1What is the purpose of the alt attribute in an <img> tag ?Beginner2What are the properties of an HTML element?Intermediate3What does the title attribute do ?Beginner4What is the difference between id and class ?Beginner5What is the difference between HTML attribute and property ?Intermediate6Can you have multiple classes on an HTML element?Intermediate7What are attributes of an HTML tag?Beginner
All Topics
1
Basics
Common Tags
Attributes and Elements
Lists
Text tags and Formatting
2
Input and Forms
Block and Inline Elements
Box model
3
Semantic Tags
Links and Images
Media and Embeds
Tables
HTML entities
HTML and CSS
4
Performance
SEO
Progressive Enhancement
5
HTML5
Custom Elements & Web Components
HTML5 APIs
SPAs
6
WCAG
Security
Best Practices
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.